package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 顾问工作时间
 * </p>
 *
 * @author tanjie
 * @since 2019-08-29
 */
@TableName("tc_consultant_work")
public class ConsultantWorkPO extends DMSBasePO<ConsultantWorkPO> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
        @TableId(value = "CONSULTANT_WORK_ID", type = IdType.AUTO)
        private Long consultantWorkId;
    /**
     * 顾问ID
     */
    @TableField("CONSULTANT_ID")
    private String consultantId;
    /**
     * 所属经销商CODE
     */
    @TableField("OWNER_CODE")
    private String ownerCode;
    /**
     * 该顾问工作时间(单位星期,多个星期使用&分割)
     */
    @TableField("WORK_TIME")
    private String workTime;
    /**
     * 当前顾问分配线索权重比
     */
    @TableField("CONSULTANT_RATIO")
    private Integer consultantRatio;
    /**
     * 当天接收到的线索数
     */
    @TableField("CLUES_BY_DAY")
    private Integer cluesByDay;
    /**
     * 线索数有效时间
     */
    @TableField("CLUES_DAY_VALID")
    private LocalDateTime cluesDayValid;
    /**
     * 可分配来源
     */
    @TableField("SOURCE_TYPE")
    private String sourceType;
    /**
     * 是否可分配
     */
    @TableField("IS_ALLOT")
    private Integer isAllot;
    /**
     * 逻辑删除标志：是否删除
     */
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public ConsultantWorkPO() {
        super();
    }


    public Long getConsultantWorkId() {
        return consultantWorkId;
    }

    public void setConsultantWorkId(Long consultantWorkId) {
        this.consultantWorkId = consultantWorkId;
    }

    public String getConsultantId() {
        return consultantId;
    }

    public void setConsultantId(String consultantId) {
        this.consultantId = consultantId;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getWorkTime() {
        return workTime;
    }

    public void setWorkTime(String workTime) {
        this.workTime = workTime;
    }

    public Integer getConsultantRatio() {
        return consultantRatio;
    }

    public void setConsultantRatio(Integer consultantRatio) {
        this.consultantRatio = consultantRatio;
    }

    public Integer getCluesByDay() {
        return cluesByDay;
    }

    public void setCluesByDay(Integer cluesByDay) {
        this.cluesByDay = cluesByDay;
    }

    public LocalDateTime getCluesDayValid() {
        return cluesDayValid;
    }

    public void setCluesDayValid(LocalDateTime cluesDayValid) {
        this.cluesDayValid = cluesDayValid;
    }

    public String getSourceType() {
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

    public Integer getIsAllot() {
        return isAllot;
    }

    public void setIsAllot(Integer isAllot) {
        this.isAllot = isAllot;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.consultantWorkId;
    }

    @Override
    public String toString() {
        return "ConsultantWorkPO{" +
        "consultantWorkId=" + consultantWorkId +
        ", consultantId=" + consultantId +
        ", ownerCode=" + ownerCode +
        ", workTime=" + workTime +
        ", consultantRatio=" + consultantRatio +
        ", cluesByDay=" + cluesByDay +
        ", cluesDayValid=" + cluesDayValid +
                ", sourceType=" + sourceType +
                ", isAllot=" + isAllot +
        ", isDeleted=" + isDeleted +
        "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author tanjie
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "consultantWorkId");
    }


}
